home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / sun / volume2 / calentool / patch5c < prev    next >
Encoding:
Internet Message Format  |  1990-02-04  |  59.7 KB

  1. Subject:  v02i005:  calentool - patch level 5, Part 3/4
  2. Newsgroups: comp.sources.sun
  3. Approved: mcgrew@aramis.rutgers.edu
  4.  
  5. Submitted-by: Bill Randle <billr@saab.cna.tek.com>
  6. Posting-number: Volume 2, Issue 5
  7. Archive-name: calentool/patch5c
  8.  
  9. #! /bin/sh
  10. # This is a shell archive.  Remove anything before this line, then unpack
  11. # it by saving it into a file and typing "sh file".  To overwrite existing
  12. # files, type "sh file -c".  You can also feed this as standard input via
  13. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  14. # will see the following message at the end:
  15. #        "End of archive 3 (of 4)."
  16. # Contents:  patches05c
  17. # Wrapped by billr@saab on Mon Dec 18 17:23:00 1989
  18. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  19. if test -f 'patches05c' -a "${1}" != "-c" ; then 
  20.   echo shar: Will not clobber existing file \"'patches05c'\"
  21. else
  22. echo shar: Extracting \"'patches05c'\" \(57477 characters\)
  23. sed "s/^X//" >'patches05c' <<'END_OF_FILE'
  24. X*** /tmp/,RCSt1a16911    Fri Dec 15 17:22:26 1989
  25. X--- calentool.c    Fri Dec 15 17:17:03 1989
  26. X***************
  27. X*** 1,5
  28. X  /*
  29. X!  * $Header: calentool.c,v 2.2 89/07/19 20:25:41 billr Exp $
  30. X   */
  31. X  /*
  32. X   * calentool.c
  33. X
  34. X--- 1,5 -----
  35. X  /*
  36. X!  * $Header: calentool.c,v 2.3 89/12/15 17:16:58 billr Exp $
  37. X   */
  38. X  /*
  39. X   * calentool.c
  40. X***************
  41. X*** 33,39
  42. X  
  43. X  extern Pixfont *font, *sfont;
  44. X  extern char apts_pathname[], tmpapts_pathname[];
  45. X! extern char todays_date[];
  46. X  extern char version[];
  47. X  extern Panel_item clock_pi;
  48. X  extern Frame fframe;
  49. X
  50. X--- 33,39 -----
  51. X  
  52. X  extern Pixfont *font, *sfont;
  53. X  extern char apts_pathname[], tmpapts_pathname[];
  54. X! extern char clockstr[];
  55. X  extern char version[];
  56. X  extern char *smonthnames[];
  57. X  extern Panel_item clock_pi;
  58. X***************
  59. X*** 35,40
  60. X  extern char apts_pathname[], tmpapts_pathname[];
  61. X  extern char todays_date[];
  62. X  extern char version[];
  63. X  extern Panel_item clock_pi;
  64. X  extern Frame fframe;
  65. X  extern Panel panel;
  66. X
  67. X--- 35,41 -----
  68. X  extern char apts_pathname[], tmpapts_pathname[];
  69. X  extern char clockstr[];
  70. X  extern char version[];
  71. X+ extern char *smonthnames[];
  72. X  extern Panel_item clock_pi;
  73. X  extern Frame fframe;
  74. X  extern Panel panel;
  75. X***************
  76. X*** 38,43
  77. X  extern Panel_item clock_pi;
  78. X  extern Frame fframe;
  79. X  extern Panel panel;
  80. X  #ifndef NO_SUN_MOON
  81. X  extern Frame sframe;
  82. X  #endif
  83. X
  84. X--- 39,45 -----
  85. X  extern Panel_item clock_pi;
  86. X  extern Frame fframe;
  87. X  extern Panel panel;
  88. X+ extern Rect *closed_rect;
  89. X  #ifndef NO_SUN_MOON
  90. X  extern Frame sframe;
  91. X  #endif
  92. X***************
  93. X*** 71,77
  94. X  int one_based = 0, new_entry = 0, version2 = 0;
  95. X  int otherfile = 0;
  96. X  char *othername;
  97. X! int beep = 0, show_time = 0;
  98. X  int include_old = 0, save_old = 0;
  99. X  #ifndef NO_HOLIDAYS
  100. X  int holiday_a = 0, holiday_c = 0, holiday_i = 0;
  101. X
  102. X--- 73,79 -----
  103. X  int one_based = 0, new_entry = 0, version2 = 0;
  104. X  int otherfile = 0;
  105. X  char *othername;
  106. X! int beep = 0, show_time = 0, beep_open = 0;
  107. X  int include_old = 0, save_old = 0;
  108. X  #ifndef NO_HOLIDAYS
  109. X  int holiday_a = 0, holiday_c = 0, holiday_i = 0;
  110. X***************
  111. X*** 86,92
  112. X  Cursor wait_cursor;
  113. X  char orig_apts_pathname[160];
  114. X  int orig_ro;
  115. X! char timestr[16], datestr_day[3], datestr_mon[4];
  116. X  struct pr_prpos where;
  117. X  int working_msg;
  118. X  
  119. X
  120. X--- 88,94 -----
  121. X  Cursor wait_cursor;
  122. X  char orig_apts_pathname[160];
  123. X  int orig_ro;
  124. X! char timestr[16], datestr_day[3];
  125. X  struct pr_prpos where;
  126. X  int working_msg;
  127. X  int hour24, monday_first, day_first;
  128. X***************
  129. X*** 89,94
  130. X  char timestr[16], datestr_day[3], datestr_mon[4];
  131. X  struct pr_prpos where;
  132. X  int working_msg;
  133. X  
  134. X  static short icon_data[] = {
  135. X  #include "std.icon"
  136. X
  137. X--- 91,98 -----
  138. X  char timestr[16], datestr_day[3];
  139. X  struct pr_prpos where;
  140. X  int working_msg;
  141. X+ int hour24, monday_first, day_first;
  142. X+ int expire_days = 0;
  143. X  
  144. X  static short icon_data[] = {
  145. X  #include "std.icon"
  146. X***************
  147. X*** 146,152
  148. X  mpr_static(tri_right_pr, 16, 16, 1, tri_right_data);
  149. X  
  150. X  char *strcpy(), *strcat(), *rindex();
  151. X! static Notify_value cleanup(), itimer_handler();
  152. X  Notify_value myframe_interposer();
  153. X  
  154. X  main(argc,argv)
  155. X
  156. X--- 150,156 -----
  157. X  mpr_static(tri_right_pr, 16, 16, 1, tri_right_data);
  158. X  
  159. X  char *strcpy(), *strcat(), *rindex();
  160. X! static Notify_value leave(), itimer_handler();
  161. X  Notify_value myframe_interposer();
  162. X  
  163. X  main(argc,argv)
  164. X***************
  165. X*** 164,169
  166. X          progname = *argv;
  167. X  
  168. X      nr_weekdays = NR_WEEKDAYS;
  169. X      n_tslots = (N_TSLOTS > N_SLOTS ? N_SLOTS : N_TSLOTS);
  170. X  
  171. X      get_today();    /* initial day is today */
  172. X
  173. X--- 168,175 -----
  174. X          progname = *argv;
  175. X  
  176. X      nr_weekdays = NR_WEEKDAYS;
  177. X+     monday_first = MON_FIRST;
  178. X+     hour24 = HOUR_24;
  179. X      n_tslots = (N_TSLOTS > N_SLOTS ? N_SLOTS : N_TSLOTS);
  180. X  
  181. X      get_today();    /* initial day is today */
  182. X***************
  183. X*** 169,175
  184. X      get_today();    /* initial day is today */
  185. X      current = today;
  186. X      read_only = 0;
  187. X!     working_msg = 1;
  188. X  
  189. X      /*
  190. X       * Check for -p, -P or -m option, which means we don't want
  191. X
  192. X--- 175,181 -----
  193. X      get_today();    /* initial day is today */
  194. X      current = today;
  195. X      read_only = 0;
  196. X!     working_msg = 0;
  197. X  
  198. X      /*
  199. X       * Check for -p, -P, -m or -M option, which means we don't want
  200. X***************
  201. X*** 172,178
  202. X      working_msg = 1;
  203. X  
  204. X      /*
  205. X!      * Check for -p, -P or -m option, which means we don't want
  206. X       * to create the tool. Also check for -Wp so we can supply
  207. X       * a resonable default if the user doesn't supply one.
  208. X       */
  209. X
  210. X--- 178,184 -----
  211. X      working_msg = 0;
  212. X  
  213. X      /*
  214. X!      * Check for -p, -P, -m or -M option, which means we don't want
  215. X       * to create the tool. Also check for -Wp so we can supply
  216. X       * a resonable default if the user doesn't supply one.
  217. X       */
  218. X***************
  219. X*** 179,185
  220. X      i = argc;
  221. X      while (--i > 0) {
  222. X          if (!strncmp(argv[i], "-p", 2) || !strcmp(argv[i], "-m")
  223. X!             || !strncmp(argv[i], "-P", 2)) {
  224. X              /* standard getopt doesn't allow optional
  225. X               * arguments, so we do a check here for
  226. X               * obsolete usage of the -p option
  227. X
  228. X--- 185,191 -----
  229. X      i = argc;
  230. X      while (--i > 0) {
  231. X          if (!strncmp(argv[i], "-p", 2) || !strcmp(argv[i], "-m")
  232. X!             || !strncmp(argv[i], "-P", 2) || !strcmp(argv[i], "-M")) {
  233. X              /* standard getopt doesn't allow optional
  234. X               * arguments, so we do a check here for
  235. X               * obsolete usage of the -p option
  236. X***************
  237. X*** 205,211
  238. X                  0);
  239. X      }
  240. X  
  241. X!     while ((flag = getopt(argc, argv, "57bd:f:im:op:P:rtu:zH:h:w")) != EOF)
  242. X          switch (flag) {   
  243. X              case 'f':    /* use this file */
  244. X              otherfile = 1;
  245. X
  246. X--- 211,217 -----
  247. X                  0);
  248. X      }
  249. X  
  250. X!     while ((flag = getopt(argc, argv, "1:2:567bBd:eEf:im:M:op:P:rtu:zH:h:wx:")) != EOF)
  251. X          switch (flag) {   
  252. X              case 'f':    /* use this file */
  253. X              otherfile = 1;
  254. X***************
  255. X*** 220,225
  256. X              read_only = 1;
  257. X              break;
  258. X              
  259. X              case 'p':    /* print and exit */
  260. X              read_only = 1;
  261. X              switch (*optarg) {
  262. X
  263. X--- 226,251 -----
  264. X              read_only = 1;
  265. X              break;
  266. X              
  267. X+             case '1':    /* -12 -- 12 hour time */
  268. X+             if (*optarg == '2')
  269. X+                 hour24 = FALSE;
  270. X+             break;
  271. X+ 
  272. X+             case '2':    /* -24 -- 24 hour time */
  273. X+             if (*optarg == '4')
  274. X+                 hour24 = TRUE;
  275. X+             break;
  276. X+ 
  277. X+             case 'e':    /* European calendar Mon-Sun */
  278. X+             monday_first = TRUE;
  279. X+             break;
  280. X+ 
  281. X+             case 'E':    /* European style */
  282. X+             monday_first = TRUE;
  283. X+             hour24 = TRUE;
  284. X+             day_first = TRUE;
  285. X+             break;
  286. X+ 
  287. X              case 'p':    /* print and exit */
  288. X              read_only = 1;
  289. X              switch (*optarg) {
  290. X***************
  291. X*** 268,273
  292. X  
  293. X              case 'm':    /* mail today's appts and exit */
  294. X              read_only = 1;
  295. X              printit_dst = DST_MAIL;
  296. X              mailto = optarg;
  297. X              break;
  298. X
  299. X--- 294,301 -----
  300. X  
  301. X              case 'm':    /* mail today's appts and exit */
  302. X              read_only = 1;
  303. X+             if (!printit)
  304. X+                 printit = PRI_DAY;
  305. X              printit_dst = DST_MAIL;
  306. X              mailto = optarg;
  307. X              break;
  308. X***************
  309. X*** 272,277
  310. X              mailto = optarg;
  311. X              break;
  312. X  
  313. X              case 'b':    /* beep to console for pending appt */
  314. X              beep = 1;
  315. X              break;
  316. X
  317. X--- 300,314 -----
  318. X              mailto = optarg;
  319. X              break;
  320. X  
  321. X+             case 'M':    /* mail today's appts and exit (ignore
  322. X+                    some notes) */
  323. X+             read_only = 1;
  324. X+             if (!printit)
  325. X+                 printit = PRI_DAY_XNOTES;
  326. X+             printit_dst = DST_MAIL;
  327. X+             mailto = optarg;
  328. X+             break;
  329. X+ 
  330. X              case 'b':    /* beep to console for pending appt */
  331. X              beep = 1;
  332. X              break;
  333. X***************
  334. X*** 276,281
  335. X              beep = 1;
  336. X              break;
  337. X  
  338. X              case 'i':    /* include old appt files */
  339. X              include_old = 1;
  340. X              break;
  341. X
  342. X--- 313,322 -----
  343. X              beep = 1;
  344. X              break;
  345. X  
  346. X+             case 'B':    /* beep then open wondow */
  347. X+             beep_open = 1;
  348. X+             break;
  349. X+ 
  350. X              case 'i':    /* include old appt files */
  351. X              include_old = 1;
  352. X              break;
  353. X***************
  354. X*** 280,286
  355. X              include_old = 1;
  356. X              break;
  357. X  
  358. X!             case 'o':    /* save outdate appts to another file */
  359. X              save_old = 1;
  360. X              break;
  361. X  
  362. X
  363. X--- 321,327 -----
  364. X              include_old = 1;
  365. X              break;
  366. X  
  367. X!             case 'o':    /* save outdated appts to another file */
  368. X              save_old = 1;
  369. X              break;
  370. X  
  371. X***************
  372. X*** 292,298
  373. X              nr_weekdays = 5;
  374. X              break;
  375. X  
  376. X!             case '7':    /* Sun - Sat week display */
  377. X              nr_weekdays = 7;
  378. X              break;
  379. X  
  380. X
  381. X--- 333,343 -----
  382. X              nr_weekdays = 5;
  383. X              break;
  384. X  
  385. X!             case '6':    /* Mon - Sat week display */
  386. X!             nr_weekdays = 6;
  387. X!             break;
  388. X! 
  389. X!             case '7':    /* Sun - Sat (or Mon-Sun) week display */
  390. X              nr_weekdays = 7;
  391. X              break;
  392. X  
  393. X***************
  394. X*** 300,307
  395. X              update_interval = atoi(optarg);
  396. X              break;
  397. X  
  398. X!             case 'w':    /* don't display Working! message */
  399. X!             working_msg = 0;
  400. X              break;
  401. X  
  402. X              case 'z':    /* zero offset -- new style appts file */
  403. X
  404. X--- 345,352 -----
  405. X              update_interval = atoi(optarg);
  406. X              break;
  407. X  
  408. X!             case 'w':    /* display Working! message */
  409. X!             working_msg = 1;
  410. X              break;
  411. X  
  412. X              case 'x':    /* eXpire appts after so many days */
  413. X***************
  414. X*** 304,309
  415. X              working_msg = 0;
  416. X              break;
  417. X  
  418. X              case 'z':    /* zero offset -- new style appts file */
  419. X              one_based = 1;
  420. X              break;
  421. X
  422. X--- 349,358 -----
  423. X              working_msg = 1;
  424. X              break;
  425. X  
  426. X+             case 'x':    /* eXpire appts after so many days */
  427. X+             expire_days = atoi(optarg);
  428. X+             break;
  429. X+ 
  430. X              case 'z':    /* zero offset -- new style appts file */
  431. X              one_based = 1;
  432. X              break;
  433. X***************
  434. X*** 390,396
  435. X              fprintf(stderr, " -p <dwm>    // print selected day [d], week [w] or month [m] appts and exit\n");
  436. X              fprintf(stderr, " -P <dwm>    // like -p, only don't print marked notes\n");
  437. X              fprintf(stderr, " -m <user>    // mail selected days appts to <user>\n");
  438. X!             fprintf(stderr, " [-5|-7]    // 5-day or 7-day week display\n");
  439. X              fprintf(stderr, " -d <date>    // display appts for <date>\n");
  440. X              fprintf(stderr, " -b        // beep and display message when appt is pending\n");
  441. X              fprintf(stderr, " -i        // auto-include outdated appts files\n");
  442. X
  443. X--- 439,447 -----
  444. X              fprintf(stderr, " -p <dwm>    // print selected day [d], week [w] or month [m] appts and exit\n");
  445. X              fprintf(stderr, " -P <dwm>    // like -p, only don't print marked notes\n");
  446. X              fprintf(stderr, " -m <user>    // mail selected days appts to <user>\n");
  447. X!             fprintf(stderr, " -M <user>    // like -m, only don't mail marked notes\n");
  448. X!             fprintf(stderr, " [-5|-6|-7]    // 5, 6 or 7-day week display\n");
  449. X!             fprintf(stderr, " [-12|-24]    // 12 or 24 hour time format\n");
  450. X              fprintf(stderr, " -d <date>    // display appts for <date>\n");
  451. X              fprintf(stderr, " -b        // beep and display message when appt is pending\n");
  452. X              fprintf(stderr, " -B        // beep and open window when appt is pending\n");
  453. X***************
  454. X*** 393,398
  455. X              fprintf(stderr, " [-5|-7]    // 5-day or 7-day week display\n");
  456. X              fprintf(stderr, " -d <date>    // display appts for <date>\n");
  457. X              fprintf(stderr, " -b        // beep and display message when appt is pending\n");
  458. X              fprintf(stderr, " -i        // auto-include outdated appts files\n");
  459. X              fprintf(stderr, " -o        // create outdated include files\n");
  460. X              fprintf(stderr, " -t        // display time below icon\n");
  461. X
  462. X--- 444,450 -----
  463. X              fprintf(stderr, " [-12|-24]    // 12 or 24 hour time format\n");
  464. X              fprintf(stderr, " -d <date>    // display appts for <date>\n");
  465. X              fprintf(stderr, " -b        // beep and display message when appt is pending\n");
  466. X+             fprintf(stderr, " -B        // beep and open window when appt is pending\n");
  467. X              fprintf(stderr, " -i        // auto-include outdated appts files\n");
  468. X              fprintf(stderr, " -o        // create outdated include files\n");
  469. X              fprintf(stderr, " -t        // display time below icon\n");
  470. X***************
  471. X*** 397,403
  472. X              fprintf(stderr, " -o        // create outdated include files\n");
  473. X              fprintf(stderr, " -t        // display time below icon\n");
  474. X              fprintf(stderr, " -u <interval>    // time update interval (seconds)\n");
  475. X!             fprintf(stderr, " -w        // don't display 'Working!' message\n");
  476. X  #ifndef NO_HOLIDAYS
  477. X              fprintf(stderr, " -h <Aacijs>    // display selected computed holidays\n");
  478. X              fprintf(stderr, "        // A=All, a=astronomical, c=Christian,\n");
  479. X
  480. X--- 449,457 -----
  481. X              fprintf(stderr, " -o        // create outdated include files\n");
  482. X              fprintf(stderr, " -t        // display time below icon\n");
  483. X              fprintf(stderr, " -u <interval>    // time update interval (seconds)\n");
  484. X!             fprintf(stderr, " -w        // display 'Working!' message\n");
  485. X!             fprintf(stderr, " -e        // Mon-Sun week display\n");
  486. X!             fprintf(stderr, " -E        // European options (-e, -24)\n");
  487. X  #ifndef NO_HOLIDAYS
  488. X              fprintf(stderr, " -h <Aacijs>    // display selected computed holidays\n");
  489. X              fprintf(stderr, "        // A=All, a=astronomical, c=Christian,\n");
  490. X***************
  491. X*** 404,409
  492. X              fprintf(stderr, "        // i=Islamic, j=Jewish, s=secular\n");
  493. X              fprintf(stderr, " -H <Aacijs>    // like -h, only flag them as marked\n");
  494. X  #endif
  495. X              fprintf(stderr, " -z        // conversion flag (see INSTALL)\n");
  496. X              fprintf(stderr, " <window_opts>    // Suntools -W options\n");
  497. X              exit(1);
  498. X
  499. X--- 458,464 -----
  500. X              fprintf(stderr, "        // i=Islamic, j=Jewish, s=secular\n");
  501. X              fprintf(stderr, " -H <Aacijs>    // like -h, only flag them as marked\n");
  502. X  #endif
  503. X+             fprintf(stderr, " -x <days>    // expire appts after <days> days\n");
  504. X              fprintf(stderr, " -z        // conversion flag (see INSTALL)\n");
  505. X              fprintf(stderr, " <window_opts>    // Suntools -W options\n");
  506. X              exit(1);
  507. X***************
  508. X*** 410,416
  509. X              break;
  510. X          }
  511. X  
  512. X! 
  513. X      if (toolrunning) {
  514. X          (void) notify_set_signal_func(frame, cleanup, SIGHUP, NOTIFY_ASYNC);
  515. X          (void) notify_set_signal_func(frame, cleanup, SIGINT, NOTIFY_ASYNC);
  516. X
  517. X--- 465,474 -----
  518. X              break;
  519. X          }
  520. X  
  521. X!     if (printit_dst == DST_MAIL && (printit == PRI_MONTH || printit == PRI_MONTH_XNOTES)) {
  522. X!         fprintf(stderr, "calentool: can't mail month calendar\n");
  523. X!         exit(1);
  524. X!     }
  525. X      if (toolrunning) {
  526. X          (void) notify_set_signal_func(frame, leave, SIGHUP, NOTIFY_ASYNC);
  527. X          (void) notify_set_signal_func(frame, leave, SIGINT, NOTIFY_ASYNC);
  528. X***************
  529. X*** 412,420
  530. X  
  531. X  
  532. X      if (toolrunning) {
  533. X!         (void) notify_set_signal_func(frame, cleanup, SIGHUP, NOTIFY_ASYNC);
  534. X!         (void) notify_set_signal_func(frame, cleanup, SIGINT, NOTIFY_ASYNC);
  535. X!         (void) notify_set_signal_func(frame, cleanup, SIGTERM, NOTIFY_ASYNC);
  536. X      }
  537. X  
  538. X      /* 
  539. X
  540. X--- 470,478 -----
  541. X          exit(1);
  542. X      }
  543. X      if (toolrunning) {
  544. X!         (void) notify_set_signal_func(frame, leave, SIGHUP, NOTIFY_ASYNC);
  545. X!         (void) notify_set_signal_func(frame, leave, SIGINT, NOTIFY_ASYNC);
  546. X!         (void) notify_set_signal_func(frame, leave, SIGTERM, NOTIFY_ASYNC);
  547. X      }
  548. X  
  549. X      /* 
  550. X***************
  551. X*** 429,434
  552. X      
  553. X      if (printit) {
  554. X          print_apts(printit, printit_dst);
  555. X          exit(0);
  556. X      }
  557. X  
  558. X
  559. X--- 487,494 -----
  560. X      
  561. X      if (printit) {
  562. X          print_apts(printit, printit_dst);
  563. X+         if (save_old || expire_days)
  564. X+             expire(expire_days);
  565. X          exit(0);
  566. X      }
  567. X  
  568. X***************
  569. X*** 478,487
  570. X      icon = icon_create(0);
  571. X      rev_icon = icon_create(0);
  572. X      na_icon = icon_create(0);
  573. X!     strncpy(datestr_mon, todays_date+4, 3);
  574. X!     datestr_mon[3] = '\0';
  575. X!     strncpy(datestr_day, todays_date+8, 2);
  576. X!     datestr_day[2] = '\0';
  577. X      /* the basic standard icon */
  578. X      pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
  579. X      if (show_time) {
  580. X
  581. X--- 538,544 -----
  582. X      icon = icon_create(0);
  583. X      rev_icon = icon_create(0);
  584. X      na_icon = icon_create(0);
  585. X!     sprintf(datestr_day, "%2d", today.tm_mday);
  586. X      /* the basic standard icon */
  587. X      pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
  588. X      if (show_time) {
  589. X***************
  590. X*** 486,495
  591. X      pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
  592. X      if (show_time) {
  593. X          /* time string displayed below icon */
  594. X!         strcpy(timestr, todays_date+10);
  595. X!         if (update_interval == 60) {
  596. X!             /* display hh:mm */
  597. X!             timestr[6] = '\0';
  598. X              ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
  599. X              ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
  600. X          } else
  601. X
  602. X--- 543,551 -----
  603. X      pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
  604. X      if (show_time) {
  605. X          /* time string displayed below icon */
  606. X!         format_icon_time();
  607. X!         if (update_interval >= 60) {
  608. X!             /* no seconds displayed, adjust label position */
  609. X              ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
  610. X              ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
  611. X          }
  612. X***************
  613. X*** 492,500
  614. X              timestr[6] = '\0';
  615. X              ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
  616. X              ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
  617. X!         } else
  618. X!             /* display hh:mm:ss */
  619. X!             timestr[9] = '\0';
  620. X          /* draw a box around the time appendage */
  621. X          pr_vector(ic_pr, 0, 64, 63, 64, PIX_SET, 1);
  622. X          pr_vector(ic_pr, 63, 64, 63, 76, PIX_SET, 1);
  623. X
  624. X--- 548,559 -----
  625. X              /* no seconds displayed, adjust label position */
  626. X              ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
  627. X              ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
  628. X!         }
  629. X!         if (!hour24) {
  630. X!             /* am/pm, increase size of label rect */
  631. X!             ilabel_rect.r_left -= sfont->pf_defaultsize.x;
  632. X!             ilabel_rect.r_width += sfont->pf_defaultsize.x;
  633. X!         }
  634. X          /* draw a box around the time appendage */
  635. X          pr_vector(ic_pr, 0, 64, 63, 64, PIX_SET, 1);
  636. X          pr_vector(ic_pr, 63, 64, 63, 76, PIX_SET, 1);
  637. X***************
  638. X*** 520,526
  639. X      pf_ttext(where, PIX_SRC, sfont, datestr_day);
  640. X      where.pos.x = 39;
  641. X      where.pr = ic_pr;
  642. X!     pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  643. X      where.pr = na_ic_pr;
  644. X      pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  645. X      where.pr = rev_ic_pr;
  646. X
  647. X--- 579,585 -----
  648. X      pf_ttext(where, PIX_SRC, sfont, datestr_day);
  649. X      where.pos.x = 39;
  650. X      where.pr = ic_pr;
  651. X!     pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  652. X      where.pr = na_ic_pr;
  653. X      pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  654. X      where.pr = rev_ic_pr;
  655. X***************
  656. X*** 522,528
  657. X      where.pr = ic_pr;
  658. X      pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  659. X      where.pr = na_ic_pr;
  660. X!     pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  661. X      where.pr = rev_ic_pr;
  662. X      pf_ttext(where, PIX_SRC, sfont, datestr_mon);
  663. X      (void)icon_init_from_pr(icon, ic_pr);
  664. X
  665. X--- 581,587 -----
  666. X      where.pr = ic_pr;
  667. X      pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  668. X      where.pr = na_ic_pr;
  669. X!     pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  670. X      where.pr = rev_ic_pr;
  671. X      pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
  672. X      (void)icon_init_from_pr(icon, ic_pr);
  673. X***************
  674. X*** 524,530
  675. X      where.pr = na_ic_pr;
  676. X      pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  677. X      where.pr = rev_ic_pr;
  678. X!     pf_ttext(where, PIX_SRC, sfont, datestr_mon);
  679. X      (void)icon_init_from_pr(icon, ic_pr);
  680. X      (void)icon_init_from_pr(rev_icon, rev_ic_pr);
  681. X      (void)icon_init_from_pr(na_icon, na_ic_pr);
  682. X
  683. X--- 583,589 -----
  684. X      where.pr = na_ic_pr;
  685. X      pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  686. X      where.pr = rev_ic_pr;
  687. X!     pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
  688. X      (void)icon_init_from_pr(icon, ic_pr);
  689. X      (void)icon_init_from_pr(rev_icon, rev_ic_pr);
  690. X      (void)icon_init_from_pr(na_icon, na_ic_pr);
  691. X***************
  692. X*** 569,574
  693. X               FRAME_ICON, icon,
  694. X               0);
  695. X  
  696. X      create_panel();
  697. X      create_main_window();
  698. X      create_attr_frame();    /* normally hidden */
  699. X
  700. X--- 628,634 -----
  701. X               FRAME_ICON, icon,
  702. X               0);
  703. X  
  704. X+     closed_rect = (Rect *)window_get(frame, FRAME_CLOSED_RECT);
  705. X      create_panel();
  706. X      create_main_window();
  707. X      create_attr_frame();    /* normally hidden */
  708. X***************
  709. X*** 594,600
  710. X  
  711. X      window_main_loop(frame);
  712. X  
  713. X!     cleanup();
  714. X  }            
  715. X               
  716. X  
  717. X
  718. X--- 654,660 -----
  719. X  
  720. X      window_main_loop(frame);
  721. X  
  722. X!     leave();
  723. X  }            
  724. X               
  725. X  
  726. X***************
  727. X*** 613,631
  728. X      (void) notify_set_itimer_func(frame, itimer_handler, ITIMER_REAL, &cal_timer, NULL);
  729. X      get_today();
  730. X      /* update date/time displayed in the panel */
  731. X!     panel_set(clock_pi, PANEL_LABEL_STRING, todays_date, 0);
  732. X!     if (show_time && (int)window_get(frame, FRAME_CLOSED)) {
  733. X!         strcpy(timestr, todays_date+10);
  734. X!         if (update_interval == 60)
  735. X!             /* display hh:mm */
  736. X!             timestr[6] = '\0';
  737. X!         else
  738. X!             /* display hh:mm:ss */
  739. X!             timestr[9] = '\0';
  740. X!         cur_icon = (Icon) window_get(frame, FRAME_ICON);
  741. X!         icon_set(cur_icon, ICON_LABEL, timestr, 0);
  742. X!         window_set(frame, FRAME_ICON, cur_icon, 0);
  743. X!     }
  744. X  #ifndef NO_SUN_MOON
  745. X      /* update data in Sun Data frame (if it's open) */
  746. X      if (sframe)
  747. X
  748. X--- 673,681 -----
  749. X      (void) notify_set_itimer_func(frame, itimer_handler, ITIMER_REAL, &cal_timer, NULL);
  750. X      get_today();
  751. X      /* update date/time displayed in the panel */
  752. X!     panel_set(clock_pi, PANEL_LABEL_STRING, clockstr, 0);
  753. X!     if (show_time && (int)window_get(frame, FRAME_CLOSED))
  754. X!         update_icon_time();
  755. X  #ifndef NO_SUN_MOON
  756. X      /* update data in Sun Data frame (if it's open) */
  757. X      if (sframe)
  758. X***************
  759. X*** 739,745
  760. X          }
  761. X      } else {
  762. X           /* notify the user via the console (once) ... */
  763. X!         if (beep && sno != echoed_sno) {
  764. X              echoed_sno = sno;
  765. X              window_bell(frame);
  766. X              if ((console = fopen("/dev/console", "w")) != NULL) {
  767. X
  768. X--- 789,795 -----
  769. X          }
  770. X      } else {
  771. X           /* notify the user via the console (once) ... */
  772. X!         if ((beep || beep_open) && sno != echoed_sno) {
  773. X              echoed_sno = sno;
  774. X              window_bell(frame);
  775. X              if (beep_open)
  776. X***************
  777. X*** 742,751
  778. X          if (beep && sno != echoed_sno) {
  779. X              echoed_sno = sno;
  780. X              window_bell(frame);
  781. X!             if ((console = fopen("/dev/console", "w")) != NULL) {
  782. X!                 fprintf(console, "%s\n", slots[sno].cur_appt->str);
  783. X!                 fclose(console);
  784. X!             }
  785. X              /*
  786. X               * also put a copy in ~/.msgfile, in case
  787. X               * nlock(1) is running
  788. X
  789. X--- 792,804 -----
  790. X          if ((beep || beep_open) && sno != echoed_sno) {
  791. X              echoed_sno = sno;
  792. X              window_bell(frame);
  793. X!             if (beep_open)
  794. X!                 window_set(frame, FRAME_CLOSED, FALSE, 0);
  795. X!             if (beep)
  796. X!                 if ((console = fopen("/dev/console", "w")) != NULL) {
  797. X!                     fprintf(console, "<< %s >> %s\n", progname, slots[sno].cur_appt->str);
  798. X!                     fclose(console);
  799. X!                 }
  800. X              /*
  801. X               * also put a copy in ~/.msgfile, in case
  802. X               * nlock(1) is running
  803. X***************
  804. X*** 771,778
  805. X              /* so that it opens on today */
  806. X              olddate = current = today;
  807. X              /* update date field of the icons */
  808. X!             strncpy(datestr_mon, todays_date+4, 3);
  809. X!             strncpy(datestr_day, todays_date+8, 2);
  810. X              /* replace the date */
  811. X              where.pr = ic_pr;
  812. X              where.pos.x = 13;
  813. X
  814. X--- 824,830 -----
  815. X              /* so that it opens on today */
  816. X              olddate = current = today;
  817. X              /* update date field of the icons */
  818. X!             sprintf(datestr_day, "%d", today.tm_mday);
  819. X              /* replace the date */
  820. X              where.pr = ic_pr;
  821. X              where.pos.x = 13;
  822. X***************
  823. X*** 790,796
  824. X              pf_ttext(where, PIX_SRC, sfont, datestr_day);
  825. X              where.pos.x = 39;
  826. X              where.pr = ic_pr;
  827. X!             pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  828. X              where.pr = na_ic_pr;
  829. X              pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  830. X              where.pr = rev_ic_pr;
  831. X
  832. X--- 842,848 -----
  833. X              pf_ttext(where, PIX_SRC, sfont, datestr_day);
  834. X              where.pos.x = 39;
  835. X              where.pr = ic_pr;
  836. X!             pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  837. X              where.pr = na_ic_pr;
  838. X              pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  839. X              where.pr = rev_ic_pr;
  840. X***************
  841. X*** 792,798
  842. X              where.pr = ic_pr;
  843. X              pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  844. X              where.pr = na_ic_pr;
  845. X!             pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  846. X              where.pr = rev_ic_pr;
  847. X              pf_ttext(where, PIX_SRC, sfont, datestr_mon);
  848. X              icon_set(icon, ICON_IMAGE, ic_pr, 0);
  849. X
  850. X--- 844,850 -----
  851. X              where.pr = ic_pr;
  852. X              pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  853. X              where.pr = na_ic_pr;
  854. X!             pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  855. X              where.pr = rev_ic_pr;
  856. X              pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
  857. X              icon_set(icon, ICON_IMAGE, ic_pr, 0);
  858. X***************
  859. X*** 794,800
  860. X              where.pr = na_ic_pr;
  861. X              pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  862. X              where.pr = rev_ic_pr;
  863. X!             pf_ttext(where, PIX_SRC, sfont, datestr_mon);
  864. X              icon_set(icon, ICON_IMAGE, ic_pr, 0);
  865. X              icon_set(rev_icon, ICON_IMAGE, rev_ic_pr, 0);
  866. X              icon_set(na_icon, ICON_IMAGE, na_ic_pr, 0);
  867. X
  868. X--- 846,852 -----
  869. X              where.pr = na_ic_pr;
  870. X              pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  871. X              where.pr = rev_ic_pr;
  872. X!             pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
  873. X              icon_set(icon, ICON_IMAGE, ic_pr, 0);
  874. X              icon_set(rev_icon, ICON_IMAGE, rev_ic_pr, 0);
  875. X              icon_set(na_icon, ICON_IMAGE, na_ic_pr, 0);
  876. X***************
  877. X*** 824,830
  878. X  }
  879. X  
  880. X  static Notify_value
  881. X! cleanup(me, signal, when)
  882. X  Notify_client me;
  883. X  int signal;
  884. X  Notify_signal_mode when;
  885. X
  886. X--- 876,882 -----
  887. X  }
  888. X  
  889. X  static Notify_value
  890. X! leave(me, signal, when)
  891. X  Notify_client me;
  892. X  int signal;
  893. X  Notify_signal_mode when;
  894. X***************
  895. X*** 831,836
  896. X  {
  897. X      if (day_is_open)
  898. X          close_day();
  899. X      if (access(tmpapts_pathname, R_OK) == 0 && unlink(tmpapts_pathname) < 0)
  900. X          perror(tmpapts_pathname);
  901. X      exit(0);
  902. X
  903. X--- 883,894 -----
  904. X  {
  905. X      if (day_is_open)
  906. X          close_day();
  907. X+ 
  908. X+     /* create outdated include files (if necessary) */
  909. X+     if (save_old || expire_days)
  910. X+         expire(expire_days);
  911. X+ 
  912. X+     /* delete tmp file */
  913. X      if (access(tmpapts_pathname, R_OK) == 0 && unlink(tmpapts_pathname) < 0)
  914. X          perror(tmpapts_pathname);
  915. X      exit(0);
  916. X*** /tmp/,RCSt1a16942    Fri Dec 15 17:23:02 1989
  917. X--- holidays.c    Fri Dec 15 17:17:37 1989
  918. X***************
  919. X*** 1,5
  920. X  /*
  921. X!  * $Header: holidays.c,v 2.1 89/05/09 14:19:10 billr Exp $
  922. X   */
  923. X  /*
  924. X   * holidays.c
  925. X
  926. X--- 1,5 -----
  927. X  /*
  928. X!  * $Header: holidays.c,v 2.2 89/12/15 17:17:34 billr Exp $
  929. X   */
  930. X  /*
  931. X   * holidays.c
  932. X***************
  933. X*** 81,86
  934. X  
  935. X  extern struct tm current;    /* current day displayed from calentool */
  936. X  int    marked_note;
  937. X  
  938. X  int
  939. X  a_dates(appt, flag)
  940. X
  941. X--- 81,87 -----
  942. X  
  943. X  extern struct tm current;    /* current day displayed from calentool */
  944. X  int    marked_note;
  945. X+ int    save_year = -1;
  946. X  
  947. X  int
  948. X  a_dates(appt, flag)
  949. X***************
  950. X*** 277,282
  951. X      double    day, hday;
  952. X      char     *julian_time();
  953. X  
  954. X      hday = (*func)(current.tm_year+1900);
  955. X      gregorian_date(&day, &month, &year, hday);
  956. X      if (current.tm_mon == --month && current.tm_mday == (int)day) {
  957. X
  958. X--- 278,287 -----
  959. X      double    day, hday;
  960. X      char     *julian_time();
  961. X  
  962. X+     if (current.tm_year != save_year) {
  963. X+         datelib_init(current.tm_year+1900);
  964. X+         save_year = current.tm_year;
  965. X+     }
  966. X      hday = (*func)(current.tm_year+1900);
  967. X      gregorian_date(&day, &month, &year, hday);
  968. X      if (current.tm_mon == --month && current.tm_mday == (int)day) {
  969. X***************
  970. X*** 284,289
  971. X          aptr->month = current.tm_mon;
  972. X          aptr->day = current.tm_mday;
  973. X          aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  974. X          aptr->flags = (A_NOTE | READONLY);
  975. X          if (marked_note)
  976. X              aptr->flags |= MARKED;
  977. X
  978. X--- 289,295 -----
  979. X          aptr->month = current.tm_mon;
  980. X          aptr->day = current.tm_mday;
  981. X          aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  982. X+         aptr->runlength = 0;
  983. X          aptr->flags = (A_NOTE | READONLY);
  984. X          if (marked_note)
  985. X              aptr->flags |= MARKED;
  986. X***************
  987. X*** 311,316
  988. X      int    month, year;
  989. X      int    match = 0;
  990. X  
  991. X      (void)(*func)(current.tm_year+1900, &nr_dates, &date1, &date2, &year1, &year2);
  992. X      gregorian_date(&day, &month, &year, date1);
  993. X      if (current.tm_mon == --month && current.tm_mday == (int)day)
  994. X
  995. X--- 317,326 -----
  996. X      int    month, year;
  997. X      int    match = 0;
  998. X  
  999. X+     if (current.tm_year != save_year) {
  1000. X+         datelib_init(current.tm_year+1900);
  1001. X+         save_year = current.tm_year;
  1002. X+     }
  1003. X      (void)(*func)(current.tm_year+1900, &nr_dates, &date1, &date2, &year1, &year2);
  1004. X      gregorian_date(&day, &month, &year, date1);
  1005. X      if (current.tm_mon == --month && current.tm_mday == (int)day)
  1006. X***************
  1007. X*** 325,330
  1008. X          aptr->month = current.tm_mon;
  1009. X          aptr->day = current.tm_mday;
  1010. X          aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  1011. X          aptr->flags = (A_NOTE | READONLY);
  1012. X          if (marked_note)
  1013. X              aptr->flags |= MARKED;
  1014. X
  1015. X--- 335,341 -----
  1016. X          aptr->month = current.tm_mon;
  1017. X          aptr->day = current.tm_mday;
  1018. X          aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  1019. X+         aptr->runlength = 0;
  1020. X          aptr->flags = (A_NOTE | READONLY);
  1021. X          if (marked_note)
  1022. X              aptr->flags |= MARKED;
  1023. X***************
  1024. X*** 352,357
  1025. X      double    hday, day;
  1026. X      char    buf[32];
  1027. X  
  1028. X      hday = (*func)(current.tm_year+1900, &jyear);
  1029. X      gregorian_date(&day, &month, &year, hday);
  1030. X      if (current.tm_mon == --month && current.tm_mday == (int)day) {
  1031. X
  1032. X--- 363,372 -----
  1033. X      double    hday, day;
  1034. X      char    buf[32];
  1035. X  
  1036. X+     if (current.tm_year != save_year) {
  1037. X+         datelib_init(current.tm_year+1900);
  1038. X+         save_year = current.tm_year;
  1039. X+     }
  1040. X      hday = (*func)(current.tm_year+1900, &jyear);
  1041. X      gregorian_date(&day, &month, &year, hday);
  1042. X      if (current.tm_mon == --month && current.tm_mday == (int)day) {
  1043. X***************
  1044. X*** 360,365
  1045. X          aptr->month = current.tm_mon;
  1046. X          aptr->day = current.tm_mday;
  1047. X          aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  1048. X          aptr->flags = (A_NOTE | READONLY);
  1049. X          if (marked_note)
  1050. X              aptr->flags |= MARKED;
  1051. X
  1052. X--- 375,381 -----
  1053. X          aptr->month = current.tm_mon;
  1054. X          aptr->day = current.tm_mday;
  1055. X          aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  1056. X+         aptr->runlength = 0;
  1057. X          aptr->flags = (A_NOTE | READONLY);
  1058. X          if (marked_note)
  1059. X              aptr->flags |= MARKED;
  1060. X*** /tmp/,RCSt1a16948    Fri Dec 15 17:23:08 1989
  1061. X--- init.c    Fri Dec 15 17:17:43 1989
  1062. X***************
  1063. X*** 1,5
  1064. X  /*
  1065. X!  * $Header: init.c,v 2.2 89/07/19 20:27:59 billr Exp $
  1066. X   */
  1067. X  /*
  1068. X   * init.c
  1069. X
  1070. X--- 1,5 -----
  1071. X  /*
  1072. X!  * $Header: init.c,v 2.3 89/12/15 17:17:39 billr Exp $
  1073. X   */
  1074. X  /*
  1075. X   * init.c
  1076. X***************
  1077. X*** 424,431
  1078. X                  return(1);
  1079. X          }
  1080. X      }
  1081. X!     if (access(apts_pathname, W_OK) == -1)
  1082. X!         read_only = 1;
  1083. X      /*
  1084. X       * set permissions on tmp file based on .appointments file
  1085. X       * with the expception that we need at least write permission
  1086. X
  1087. X--- 424,432 -----
  1088. X                  return(1);
  1089. X          }
  1090. X      }
  1091. X!     if (!read_only)
  1092. X!         if (access(apts_pathname, W_OK) == -1)
  1093. X!             read_only = 1;
  1094. X      /*
  1095. X       * set permissions on tmp file based on .appointments file
  1096. X       * with the expception that we need at least write permission
  1097. X*** /tmp/,RCSt1a16953    Fri Dec 15 17:23:13 1989
  1098. X--- mpaint.c    Fri Dec 15 17:17:47 1989
  1099. X***************
  1100. X*** 1,5
  1101. X  /*
  1102. X!  * $Header: mpaint.c,v 2.2 89/07/19 20:29:01 billr Exp $
  1103. X   */
  1104. X  /*
  1105. X   * mpaint.c
  1106. X
  1107. X--- 1,5 -----
  1108. X  /*
  1109. X!  * $Header: mpaint.c,v 2.3 89/12/15 17:17:44 billr Exp $
  1110. X   */
  1111. X  /*
  1112. X   * mpaint.c
  1113. X***************
  1114. X*** 52,57
  1115. X      int read_stat;
  1116. X      struct tm Save;
  1117. X      struct appt_entry appt;
  1118. X  
  1119. X      lock_cursors();
  1120. X      /* destory future appts popup, if it exists */
  1121. X
  1122. X--- 52,58 -----
  1123. X      int read_stat;
  1124. X      struct tm Save;
  1125. X      struct appt_entry appt;
  1126. X+     int runl;
  1127. X  
  1128. X      lock_cursors();
  1129. X      /* destory future appts popup, if it exists */
  1130. X***************
  1131. X*** 91,97
  1132. X      fix_current_day();
  1133. X      Last = current;
  1134. X      working(FALSE);
  1135. X!     while ((read_stat = get_aentry(apts, &appt)) != EOF) {
  1136. X          if (read_stat)
  1137. X              continue;    /* read error (ignore) */
  1138. X          if (appt.flags & A_COMMENT)
  1139. X
  1140. X--- 92,98 -----
  1141. X      fix_current_day();
  1142. X      Last = current;
  1143. X      working(FALSE);
  1144. X!     while ((read_stat = get_aentry(apts, &appt, FALSE)) != EOF) {
  1145. X          if (read_stat)
  1146. X              continue;    /* read error (ignore) */
  1147. X          if (appt.flags & A_COMMENT)
  1148. X***************
  1149. X*** 125,133
  1150. X          } else if ((appt.flags & REPEAT) && !(appt.flags & ALL_DAYS)) {
  1151. X              if (appt.flags & EVERY_SOMEDAY)
  1152. X                  continue;
  1153. X!             while (ymd_compare(current, First) < 0) {
  1154. X!                 current.tm_mday += appt.repeat;
  1155. X!                 fix_current_day();
  1156. X              }
  1157. X              while (ymd_compare(current, Last) <= 0) {
  1158. X                  busy_today[current.tm_mday-1]++;
  1159. X
  1160. X--- 126,142 -----
  1161. X          } else if ((appt.flags & REPEAT) && !(appt.flags & ALL_DAYS)) {
  1162. X              if (appt.flags & EVERY_SOMEDAY)
  1163. X                  continue;
  1164. X!             if (appt.flags & RUN)
  1165. X!                 runl = appt.runlength;
  1166. X!             else
  1167. X!                 runl = 1;
  1168. X!             while (ymd_compare(current, First) < 0 && runl) {
  1169. X!                 if (appt.flags & RUN)
  1170. X!                     --runl;
  1171. X!                 if (runl) {
  1172. X!                     current.tm_mday += appt.repeat;
  1173. X!                     fix_current_day();
  1174. X!                 }
  1175. X              }
  1176. X              while (ymd_compare(current, Last) <= 0 && runl) {
  1177. X                  if (runl) {
  1178. X***************
  1179. X*** 129,138
  1180. X                  current.tm_mday += appt.repeat;
  1181. X                  fix_current_day();
  1182. X              }
  1183. X!             while (ymd_compare(current, Last) <= 0) {
  1184. X!                 busy_today[current.tm_mday-1]++;
  1185. X!                 current.tm_mday += appt.repeat;
  1186. X!                 fix_current_day();
  1187. X              }
  1188. X          } else if (current.tm_year == First.tm_year 
  1189. X              && current.tm_mon == First.tm_mon) {
  1190. X
  1191. X--- 138,151 -----
  1192. X                      fix_current_day();
  1193. X                  }
  1194. X              }
  1195. X!             while (ymd_compare(current, Last) <= 0 && runl) {
  1196. X!                 if (runl) {
  1197. X!                     busy_today[current.tm_mday-1]++;
  1198. X!                     current.tm_mday += appt.repeat;
  1199. X!                     fix_current_day();
  1200. X!                     if (appt.flags & RUN)
  1201. X!                         --runl;
  1202. X!                 }
  1203. X              }
  1204. X          } else if (current.tm_year == First.tm_year 
  1205. X              && current.tm_mon == First.tm_mon) {
  1206. X***************
  1207. X*** 177,184
  1208. X  #endif
  1209. X  
  1210. X      y = top_border;                /* Draw all day boxes. */
  1211. X!     x = 64*start_dow + left_border;
  1212. X!         days_in_week = start_dow;
  1213. X          c[0] = ' ';
  1214. X          c[1] = '1';
  1215. X          c[2] = ' ';
  1216. X
  1217. X--- 190,207 -----
  1218. X  #endif
  1219. X  
  1220. X      y = top_border;                /* Draw all day boxes. */
  1221. X!     if (monday_first) {
  1222. X!         if (start_dow == SUN) {
  1223. X!             x = 64*6 + left_border;
  1224. X!             days_in_week = 6;
  1225. X!         } else {
  1226. X!             x = 64*(start_dow - 1) + left_border;
  1227. X!             days_in_week = start_dow -1 ;
  1228. X!         }
  1229. X!     } else {
  1230. X!         x = 64*start_dow + left_border;
  1231. X!         days_in_week = start_dow;
  1232. X!     }
  1233. X          c[0] = ' ';
  1234. X          c[1] = '1';
  1235. X          c[2] = ' ';
  1236. X***************
  1237. X*** 218,226
  1238. X          }
  1239. X          x = left_border + 27;
  1240. X          y = top_border - 16;
  1241. X!     for (i=0; i<7; i++) {        /* Sun Mon ... Sat */
  1242. X!         pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]);
  1243. X!                 x += 64;
  1244. X          }
  1245. X  
  1246. X      bottom_border = boxlims[n_days-1].highy;
  1247. X
  1248. X--- 241,257 -----
  1249. X          }
  1250. X          x = left_border + 27;
  1251. X          y = top_border - 16;
  1252. X!     if (monday_first) {
  1253. X!         for (i=1; i<7; i++) {        /* Mon ... Sat Sun */
  1254. X!             pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]);
  1255. X!             x += 64;
  1256. X!         }
  1257. X!         pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[0][0]);
  1258. X!     } else {
  1259. X!         for (i=0; i<7; i++) {        /* Sun Mon ... Sat */
  1260. X!             pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]);
  1261. X!             x += 64;
  1262. X!         }
  1263. X          }
  1264. X  
  1265. X      bottom_border = boxlims[n_days-1].highy;
  1266. X*** /tmp/,RCSt1a16958    Fri Dec 15 17:23:18 1989
  1267. X--- notify.c    Fri Dec 15 17:17:55 1989
  1268. X***************
  1269. X*** 1,5
  1270. X  /*
  1271. X!  * $Header: notify.c,v 2.1 89/05/09 14:23:13 billr Exp $
  1272. X   */
  1273. X  /*
  1274. X   * notify.c
  1275. X
  1276. X--- 1,5 -----
  1277. X  /*
  1278. X!  * $Header: notify.c,v 2.2 89/12/15 17:17:49 billr Exp $
  1279. X   */
  1280. X  /*
  1281. X   * notify.c
  1282. X***************
  1283. X*** 53,58
  1284. X  extern Panel_item repeat_pi, remind_pi, daysel_pi;
  1285. X  extern Panel_item everyx_pi, whichwk_pi, marked_pi;
  1286. X  extern Panel_item del_choice_pi, setdate_pi;
  1287. X  #ifndef NO_SUN_MOON
  1288. X  extern Frame mframe, sframe;
  1289. X  extern Panel_item moonbutton_pi, sunbutton_pi;
  1290. X
  1291. X--- 53,59 -----
  1292. X  extern Panel_item repeat_pi, remind_pi, daysel_pi;
  1293. X  extern Panel_item everyx_pi, whichwk_pi, marked_pi;
  1294. X  extern Panel_item del_choice_pi, setdate_pi;
  1295. X+ extern Panel_item runl_pi;
  1296. X  #ifndef NO_SUN_MOON
  1297. X  extern Frame mframe, sframe;
  1298. X  extern Panel_item moonbutton_pi, sunbutton_pi;
  1299. X***************
  1300. X*** 77,83
  1301. X  extern int show_future;
  1302. X  extern int show_time;
  1303. X  extern int update_interval;
  1304. X- extern char todays_date[], timestr[];
  1305. X  extern struct appt_entry shelf_appt;
  1306. X  
  1307. X  int i;
  1308. X
  1309. X--- 78,83 -----
  1310. X  extern int show_future;
  1311. X  extern int show_time;
  1312. X  extern int update_interval;
  1313. X  extern struct appt_entry shelf_appt;
  1314. X  extern int day_first;
  1315. X  
  1316. X***************
  1317. X*** 79,84
  1318. X  extern int update_interval;
  1319. X  extern char todays_date[], timestr[];
  1320. X  extern struct appt_entry shelf_appt;
  1321. X  
  1322. X  int i;
  1323. X  
  1324. X
  1325. X--- 79,85 -----
  1326. X  extern int show_time;
  1327. X  extern int update_interval;
  1328. X  extern struct appt_entry shelf_appt;
  1329. X+ extern int day_first;
  1330. X  
  1331. X  int i;
  1332. X  
  1333. X***************
  1334. X*** 419,425
  1335. X                  break;
  1336. X  
  1337. X              case 5:    /* change date */
  1338. X!                 sprintf(date, "%d/%d/%02d", Save.tm_mon+1, Save.tm_mday, Save.tm_year);
  1339. X                  panel_set_value(setdate_pi, date);
  1340. X                  do {
  1341. X                      window_loop(date_frame);
  1342. X
  1343. X--- 420,429 -----
  1344. X                  break;
  1345. X  
  1346. X              case 5:    /* change date */
  1347. X!                 if (day_first)
  1348. X!                     sprintf(date, "%d/%d/%02d", Save.tm_mday, Save.tm_mon+1, Save.tm_year);
  1349. X!                 else
  1350. X!                     sprintf(date, "%d/%d/%02d", Save.tm_mon+1, Save.tm_mday, Save.tm_year);
  1351. X                  panel_set_value(setdate_pi, date);
  1352. X                  do {
  1353. X                      window_loop(date_frame);
  1354. X***************
  1355. X*** 1018,1023
  1356. X              new_entry = 1;
  1357. X              flag |= LOOKAHEAD;
  1358. X              apt->lookahead = value;
  1359. X          }
  1360. X      }
  1361. X  
  1362. X
  1363. X--- 1022,1037 -----
  1364. X              new_entry = 1;
  1365. X              flag |= LOOKAHEAD;
  1366. X              apt->lookahead = value;
  1367. X+         }
  1368. X+     }
  1369. X+ 
  1370. X+     /* get runlength value */
  1371. X+     value = atoi((char *)panel_get_value(runl_pi));
  1372. X+     if (value > 0) {
  1373. X+         if (apt->runlength != value) {
  1374. X+             new_entry = 1;
  1375. X+             flag |= RUN;
  1376. X+             apt->runlength = value;
  1377. X          }
  1378. X      }
  1379. X  
  1380. X*** /tmp/,RCSt1a16963    Fri Dec 15 17:23:25 1989
  1381. X--- paint.h    Fri Dec 15 17:17:59 1989
  1382. X***************
  1383. X*** 1,5
  1384. X  /*
  1385. X!  * $Header: paint.h,v 2.1 89/05/09 14:25:24 billr Exp $
  1386. X   */
  1387. X  /*
  1388. X   * paint.h
  1389. X
  1390. X--- 1,5 -----
  1391. X  /*
  1392. X!  * $Header: paint.h,v 2.2 89/12/15 17:17:57 billr Exp $
  1393. X   */
  1394. X  /*
  1395. X   * paint.h
  1396. X***************
  1397. X*** 22,27
  1398. X   * notice remains intact.
  1399. X   */
  1400. X  
  1401. X  #include <suntool/panel.h>
  1402. X  
  1403. X  extern Pixfont *font, *bigfont;
  1404. X
  1405. X--- 22,28 -----
  1406. X   * notice remains intact.
  1407. X   */
  1408. X  
  1409. X+ #ifndef NOTOOL
  1410. X  #include <suntool/panel.h>
  1411. X  
  1412. X  extern Pixfont *font, *bigfont;
  1413. X***************
  1414. X*** 27,34
  1415. X  extern Pixfont *font, *bigfont;
  1416. X  extern Canvas canvas;
  1417. X  extern Pixwin *main_pixwin;
  1418. X- extern struct tm current, today, First, Last;
  1419. X- extern struct dayslot slots[];
  1420. X  extern Pixrect *timeslot_pr, *daybox_pr, *weekarrow_pr,  *weekslot_pr;
  1421. X  extern Pixrect *weekarrowshaft_pr, *weekarrowhead_pr;
  1422. X  extern Pixrect *triangle_pr;
  1423. X
  1424. X--- 28,33 -----
  1425. X  extern Pixfont *font, *bigfont;
  1426. X  extern Canvas canvas;
  1427. X  extern Pixwin *main_pixwin;
  1428. X  extern Pixrect *timeslot_pr, *daybox_pr, *weekarrow_pr,  *weekslot_pr;
  1429. X  extern Pixrect *weekarrowshaft_pr, *weekarrowhead_pr;
  1430. X  extern Pixrect *triangle_pr;
  1431. X***************
  1432. X*** 38,44
  1433. X  extern struct weekrect week_boxes[];
  1434. X  extern int x_coord, y_coord, startx, starty;
  1435. X  extern int mainsw_state;
  1436. X- extern int dayslot_width, nr_weekdays, max_strlen, n_tslots;
  1437. X  extern int dayslot_height, weekslot_height, weekslot_width;
  1438. X  extern int ybox_height, ybox_width;
  1439. X  extern struct rect_limits boxlims[];
  1440. X
  1441. X--- 37,42 -----
  1442. X  extern struct weekrect week_boxes[];
  1443. X  extern int x_coord, y_coord, startx, starty;
  1444. X  extern int mainsw_state;
  1445. X  extern int dayslot_height, weekslot_height, weekslot_width;
  1446. X  extern int ybox_height, ybox_width;
  1447. X  extern struct rect_limits boxlims[];
  1448. X***************
  1449. X*** 44,49
  1450. X  extern struct rect_limits boxlims[];
  1451. X  extern struct rect_limits mboxlims[];
  1452. X  extern struct week_arrow week_arrows[];
  1453. X  extern char apts_pathname[], tmpapts_pathname[];
  1454. X  extern int read_only, day_is_open, version2;
  1455. X  extern char *progname;
  1456. X
  1457. X--- 42,50 -----
  1458. X  extern struct rect_limits boxlims[];
  1459. X  extern struct rect_limits mboxlims[];
  1460. X  extern struct week_arrow week_arrows[];
  1461. X+ extern Frame fframe;
  1462. X+ extern int hour24, monday_first, day_first;
  1463. X+ #endif  /* NOTOOL */
  1464. X  extern char apts_pathname[], tmpapts_pathname[];
  1465. X  extern int read_only, day_is_open, version2;
  1466. X  extern char *progname;
  1467. X***************
  1468. X*** 47,53
  1469. X  extern char apts_pathname[], tmpapts_pathname[];
  1470. X  extern int read_only, day_is_open, version2;
  1471. X  extern char *progname;
  1472. X- extern Frame fframe;
  1473. X  extern char *daynames[], *monthnames[];
  1474. X  #ifndef NO_HOLIDAYS
  1475. X  extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s;
  1476. X
  1477. X--- 48,53 -----
  1478. X  extern char apts_pathname[], tmpapts_pathname[];
  1479. X  extern int read_only, day_is_open, version2;
  1480. X  extern char *progname;
  1481. X  extern char *daynames[], *monthnames[];
  1482. X  extern int dayslot_width, nr_weekdays, max_strlen, n_tslots;
  1483. X  extern struct tm current, today, First, Last;
  1484. X***************
  1485. X*** 49,54
  1486. X  extern char *progname;
  1487. X  extern Frame fframe;
  1488. X  extern char *daynames[], *monthnames[];
  1489. X  #ifndef NO_HOLIDAYS
  1490. X  extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s;
  1491. X  
  1492. X
  1493. X--- 49,57 -----
  1494. X  extern int read_only, day_is_open, version2;
  1495. X  extern char *progname;
  1496. X  extern char *daynames[], *monthnames[];
  1497. X+ extern int dayslot_width, nr_weekdays, max_strlen, n_tslots;
  1498. X+ extern struct tm current, today, First, Last;
  1499. X+ extern struct dayslot slots[];
  1500. X  #ifndef NO_HOLIDAYS
  1501. X  extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s;
  1502. X  
  1503. X*** /tmp/,RCSt1a16968    Fri Dec 15 17:23:28 1989
  1504. X--- patchlevel.h    Fri Dec 15 17:18:02 1989
  1505. X***************
  1506. X*** 1,5
  1507. X  /*
  1508. X!  * $Header: patchlevel.h,v 2.5 89/09/19 06:19:56 billr Exp $
  1509. X   */
  1510. X  /*
  1511. X   * patchlevel.h - current patchlevel of calentool program
  1512. X
  1513. X--- 1,5 -----
  1514. X  /*
  1515. X!  * $Header: patchlevel.h,v 2.6 89/12/15 17:18:00 billr Exp $
  1516. X   */
  1517. X  /*
  1518. X   * patchlevel.h - current patchlevel of calentool program
  1519. X***************
  1520. X*** 5,8
  1521. X   * patchlevel.h - current patchlevel of calentool program
  1522. X   */
  1523. X  
  1524. X! #define PATCHLEVEL    4
  1525. X
  1526. X--- 5,8 -----
  1527. X   * patchlevel.h - current patchlevel of calentool program
  1528. X   */
  1529. X  
  1530. X! #define PATCHLEVEL    5
  1531. X*** /tmp/,RCSt1a16973    Fri Dec 15 17:23:32 1989
  1532. X--- put_aentry.c    Fri Dec 15 17:18:06 1989
  1533. X***************
  1534. X*** 1,5
  1535. X  /*
  1536. X!  * $Header: put_aentry.c,v 2.1 89/05/09 14:19:36 billr Exp $
  1537. X   */
  1538. X  /*
  1539. X   * put_aentry - write calentool style files
  1540. X
  1541. X--- 1,5 -----
  1542. X  /*
  1543. X!  * $Header: put_aentry.c,v 2.2 89/12/15 17:18:04 billr Exp $
  1544. X   */
  1545. X  /*
  1546. X   * put_aentry - write calentool style files
  1547. X***************
  1548. X*** 91,96
  1549. X  
  1550. X      if (appt->flags & LOOKAHEAD)
  1551. X          fprintf(apts_file, "<%d> ", appt->lookahead);
  1552. X      if (appt->flags & DELETED)
  1553. X          fprintf(apts_file, "# %s", appt->str);
  1554. X      else
  1555. X
  1556. X--- 91,98 -----
  1557. X  
  1558. X      if (appt->flags & LOOKAHEAD)
  1559. X          fprintf(apts_file, "<%d> ", appt->lookahead);
  1560. X+     if (appt->flags & RUN)
  1561. X+         fprintf(apts_file, "+%d ", appt->runlength);
  1562. X      if (appt->flags & DELETED)
  1563. X          fprintf(apts_file, "# %s", appt->str);
  1564. X      else
  1565. X*** /tmp/,RCSt1a16978    Fri Dec 15 17:23:36 1989
  1566. X--- ras2ps.c    Fri Dec 15 17:18:10 1989
  1567. X***************
  1568. X*** 1,5
  1569. X  /*
  1570. X!  * $Header: ras2ps.c,v 2.2 89/07/19 20:30:25 billr Exp $
  1571. X   */
  1572. X  /*
  1573. X   * ras2ps - convert Sun raster file to RLL Postscript file
  1574. X
  1575. X--- 1,5 -----
  1576. X  /*
  1577. X!  * $Header: ras2ps.c,v 2.3 89/12/15 17:18:07 billr Exp $
  1578. X   */
  1579. X  /*
  1580. X   * ras2ps - convert Sun raster file to RLL Postscript file
  1581. X***************
  1582. X*** 91,97
  1583. X       sizey = 10.0;
  1584. X       transx = transy = 0.5;
  1585. X       inv = 0;
  1586. X!      rotate = 90.0;
  1587. X       ofile = outfile;
  1588. X       
  1589. X       if (pr_load_header(infile, &rh) != 0)
  1590. X
  1591. X--- 91,97 -----
  1592. X       sizey = 10.0;
  1593. X       transx = transy = 0.5;
  1594. X       inv = 0;
  1595. X!      rotate = 0.0;
  1596. X       ofile = outfile;
  1597. X       
  1598. X       if (pr_load_header(infile, &rh) != 0)
  1599. X*** /tmp/,RCSt1a16983    Fri Dec 15 17:23:40 1989
  1600. X--- riseset.c    Fri Dec 15 17:18:14 1989
  1601. X***************
  1602. X*** 1,5
  1603. X  /*
  1604. X!  * $Header: riseset.c,v 2.2 89/07/19 20:31:05 billr Exp $
  1605. X   */
  1606. X  /*
  1607. X   * riseset.c
  1608. X
  1609. X--- 1,5 -----
  1610. X  /*
  1611. X!  * $Header: riseset.c,v 2.3 89/12/15 17:18:11 billr Exp $
  1612. X   */
  1613. X  /*
  1614. X   * riseset.c
  1615. X***************
  1616. X*** 46,51
  1617. X  #include "riseset.h"
  1618. X  
  1619. X  extern char *daynames[], *monthnames[];
  1620. X  
  1621. X  long    UTC, TDT, tim, tim2;
  1622. X  double    Julian_Day, MJD, Tu, Ru, T70, Local, GMST, LST;
  1623. X
  1624. X--- 46,52 -----
  1625. X  #include "riseset.h"
  1626. X  
  1627. X  extern char *daynames[], *monthnames[];
  1628. X+ extern int day_first;
  1629. X  
  1630. X  long    UTC, TDT, tim, tim2;
  1631. X  double    Julian_Day, MJD, Tu, Ru, T70, Local, GMST, LST;
  1632. X***************
  1633. X*** 134,141
  1634. X      ltm = localtime(&UTC);
  1635. X      sprintf(riseset_buf[B_LCT], "%.24s Local Civil Time", asctime(ltm));
  1636. X  
  1637. X!     sprintf(riseset_buf[B_DMY], "%s %s %d, %d", daynames[ltm->tm_wday],
  1638. X!         monthnames[ltm->tm_mon], ltm->tm_mday, ltm->tm_year+1900);
  1639. X      tim2 = UTC + (long)(Local + Round);    /* Compute Local Solar Time */
  1640. X      tdate= gmctime(&tim2);
  1641. X      *(tdate+19) = '\0';
  1642. X
  1643. X--- 135,146 -----
  1644. X      ltm = localtime(&UTC);
  1645. X      sprintf(riseset_buf[B_LCT], "%.24s Local Civil Time", asctime(ltm));
  1646. X  
  1647. X!     if (day_first)
  1648. X!         sprintf(riseset_buf[B_DMY], "%s %d %s %d", daynames[ltm->tm_wday],
  1649. X!             ltm->tm_mday, monthnames[ltm->tm_mon], ltm->tm_year+1900);
  1650. X!     else
  1651. X!         sprintf(riseset_buf[B_DMY], "%s %s %d, %d", daynames[ltm->tm_wday],
  1652. X!             monthnames[ltm->tm_mon], ltm->tm_mday, ltm->tm_year+1900);
  1653. X      tim2 = UTC + (long)(Local + Round);    /* Compute Local Solar Time */
  1654. X      tdate= gmctime(&tim2);
  1655. X      *(tdate+19) = '\0';
  1656. X*** /tmp/,RCSt1a16988    Fri Dec 15 17:23:45 1989
  1657. X--- tool.c    Fri Dec 15 17:18:22 1989
  1658. X***************
  1659. X*** 1,5
  1660. X  /*
  1661. X!  * $Header: tool.c,v 2.2 89/07/19 20:31:31 billr Exp $
  1662. X   */
  1663. X  /*
  1664. X   * tool.c
  1665. X
  1666. X--- 1,5 -----
  1667. X  /*
  1668. X!  * $Header: tool.c,v 2.3 89/12/15 17:18:15 billr Exp $
  1669. X   */
  1670. X  /*
  1671. X   * tool.c
  1672. X***************
  1673. X*** 45,50
  1674. X  Panel_item monthmenu_pi, yearmenu_pi, weekbutton_pi, daybutton_pi;
  1675. X  Panel_item previous_pi, next_pi, current_pi, filebutton_pi;
  1676. X  Panel_item clock_pi;
  1677. X  #ifndef NO_PRINTER
  1678. X  Panel_item printbutton_pi;
  1679. X  #endif
  1680. X
  1681. X--- 45,51 -----
  1682. X  Panel_item monthmenu_pi, yearmenu_pi, weekbutton_pi, daybutton_pi;
  1683. X  Panel_item previous_pi, next_pi, current_pi, filebutton_pi;
  1684. X  Panel_item clock_pi;
  1685. X+ Panel_item runl_pi;
  1686. X  #ifndef NO_PRINTER
  1687. X  Panel_item printbutton_pi;
  1688. X  #endif
  1689. X***************
  1690. X*** 125,130
  1691. X  Notify_value check_close();
  1692. X  int monthlength();
  1693. X  char year_str[NR_YEARS][5]; /* holds strings for year menu */
  1694. X  extern Pixwin *main_pixwin;
  1695. X  extern Cursor day_cursor, wait_cursor;
  1696. X  extern int day_is_open, mainsw_state;
  1697. X
  1698. X--- 126,132 -----
  1699. X  Notify_value check_close();
  1700. X  int monthlength();
  1701. X  char year_str[NR_YEARS][5]; /* holds strings for year menu */
  1702. X+ Rect *closed_rect;
  1703. X  extern Pixwin *main_pixwin;
  1704. X  extern Cursor day_cursor, wait_cursor;
  1705. X  extern int day_is_open, mainsw_state;
  1706. X***************
  1707. X*** 128,134
  1708. X  extern Pixwin *main_pixwin;
  1709. X  extern Cursor day_cursor, wait_cursor;
  1710. X  extern int day_is_open, mainsw_state;
  1711. X! extern char todays_date[];
  1712. X  extern struct appt_entry future[];
  1713. X  extern int findex;
  1714. X  extern struct dayslot slots[];
  1715. X
  1716. X--- 130,136 -----
  1717. X  extern Pixwin *main_pixwin;
  1718. X  extern Cursor day_cursor, wait_cursor;
  1719. X  extern int day_is_open, mainsw_state;
  1720. X! extern char clockstr[];
  1721. X  extern struct appt_entry future[];
  1722. X  extern int findex;
  1723. X  extern struct dayslot slots[];
  1724. X***************
  1725. X*** 136,141
  1726. X  extern Pixrect moon_icon_pr, sun_icon_pr;
  1727. X  #endif
  1728. X  extern char printer[];
  1729. X  
  1730. X  /* Create and init control panel */
  1731. X  create_panel()
  1732. X
  1733. X--- 138,144 -----
  1734. X  extern Pixrect moon_icon_pr, sun_icon_pr;
  1735. X  #endif
  1736. X  extern char printer[];
  1737. X+ extern int day_first;
  1738. X  
  1739. X  /* Create and init control panel */
  1740. X  create_panel()
  1741. X***************
  1742. X*** 288,293
  1743. X  
  1744. X      width = (int)window_get(panel, WIN_WIDTH);
  1745. X  
  1746. X      clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1747. X              PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x),
  1748. X              PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1749. X
  1750. X--- 291,297 -----
  1751. X  
  1752. X      width = (int)window_get(panel, WIN_WIDTH);
  1753. X  
  1754. X+     get_today();    /* get current date and time */
  1755. X      clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1756. X              PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x),
  1757. X              PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1758. X***************
  1759. X*** 289,295
  1760. X      width = (int)window_get(panel, WIN_WIDTH);
  1761. X  
  1762. X      clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1763. X!             PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x),
  1764. X              PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1765. X              PANEL_LABEL_STRING, todays_date,
  1766. X              PANEL_LABEL_FONT, font,
  1767. X
  1768. X--- 293,299 -----
  1769. X  
  1770. X      get_today();    /* get current date and time */
  1771. X      clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1772. X!             PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x),
  1773. X              PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1774. X              PANEL_LABEL_STRING, clockstr,
  1775. X              PANEL_LABEL_FONT, font,
  1776. X***************
  1777. X*** 291,297
  1778. X      clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1779. X              PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x),
  1780. X              PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1781. X!             PANEL_LABEL_STRING, todays_date,
  1782. X              PANEL_LABEL_FONT, font,
  1783. X              0);
  1784. X  
  1785. X
  1786. X--- 295,301 -----
  1787. X      clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1788. X              PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x),
  1789. X              PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1790. X!             PANEL_LABEL_STRING, clockstr,
  1791. X              PANEL_LABEL_FONT, font,
  1792. X              0);
  1793. X  
  1794. X***************
  1795. X*** 479,485
  1796. X      if (!fframe) {
  1797. X          /* create new frame and control panel */
  1798. X          fframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1799. X!                 WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
  1800. X                  WIN_Y, slots[N_SLOTS-4].slot_pos.top,
  1801. X                  FRAME_LABEL, "Future Appointments",
  1802. X                  FRAME_SHOW_LABEL, TRUE,
  1803. X
  1804. X--- 483,489 -----
  1805. X      if (!fframe) {
  1806. X          /* create new frame and control panel */
  1807. X          fframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1808. X!                 WIN_X, ATTR_COL(12),
  1809. X                  WIN_Y, slots[N_SLOTS-4].slot_pos.top,
  1810. X                  FRAME_LABEL, "Future Appointments",
  1811. X                  FRAME_SHOW_LABEL, TRUE,
  1812. X***************
  1813. X*** 484,489
  1814. X                  FRAME_LABEL, "Future Appointments",
  1815. X                  FRAME_SHOW_LABEL, TRUE,
  1816. X                  WIN_ERROR_MSG, "Can't create future frame.",
  1817. X                  0);
  1818. X  
  1819. X          fcpanel = window_create(fframe, PANEL, 0);
  1820. X
  1821. X--- 488,494 -----
  1822. X                  FRAME_LABEL, "Future Appointments",
  1823. X                  FRAME_SHOW_LABEL, TRUE,
  1824. X                  WIN_ERROR_MSG, "Can't create future frame.",
  1825. X+                 FRAME_CLOSED_RECT, closed_rect,
  1826. X                  0);
  1827. X  
  1828. X          fcpanel = window_create(fframe, PANEL, 0);
  1829. X***************
  1830. X*** 553,558
  1831. X                  0);
  1832. X      }
  1833. X      window_fit(fframe);
  1834. X  }
  1835. X  
  1836. X  /*
  1837. X
  1838. X--- 558,564 -----
  1839. X                  0);
  1840. X      }
  1841. X      window_fit(fframe);
  1842. X+     window_set(fframe, WIN_SHOW, TRUE, 0);
  1843. X  }
  1844. X  
  1845. X  /*
  1846. X***************
  1847. X*** 567,572
  1848. X      attr_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1849. X              FRAME_SHOW_LABEL, FALSE,
  1850. X              WIN_ERROR_MSG, "Can't create attributes frame.",
  1851. X              0);
  1852. X  
  1853. X      attr_panel = window_create(attr_frame, PANEL,
  1854. X
  1855. X--- 573,579 -----
  1856. X      attr_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1857. X              FRAME_SHOW_LABEL, FALSE,
  1858. X              WIN_ERROR_MSG, "Can't create attributes frame.",
  1859. X+             FRAME_CLOSED_RECT, closed_rect,
  1860. X              0);
  1861. X  
  1862. X      attr_panel = window_create(attr_frame, PANEL,
  1863. X***************
  1864. X*** 631,636
  1865. X              PANEL_BLINK_CARET, TRUE,
  1866. X              0);
  1867. X      
  1868. X      remind_pi = panel_create_item(attr_panel, PANEL_TEXT,
  1869. X              PANEL_SHOW_ITEM, TRUE,
  1870. X              PANEL_LABEL_STRING,
  1871. X
  1872. X--- 638,654 -----
  1873. X              PANEL_BLINK_CARET, TRUE,
  1874. X              0);
  1875. X      
  1876. X+     runl_pi = panel_create_item(attr_panel, PANEL_TEXT,
  1877. X+             PANEL_SHOW_ITEM, TRUE,
  1878. X+             PANEL_LABEL_STRING,
  1879. X+             "Repeat specified number of times (default forever):",
  1880. X+             PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4,
  1881. X+             PANEL_VALUE_DISPLAY_LENGTH, 4,
  1882. X+             PANEL_ITEM_X, ATTR_COL(1),
  1883. X+             PANEL_ITEM_Y, ATTR_ROW(4),
  1884. X+             PANEL_BLINK_CARET, TRUE,
  1885. X+             0);
  1886. X+ 
  1887. X      remind_pi = panel_create_item(attr_panel, PANEL_TEXT,
  1888. X              PANEL_SHOW_ITEM, TRUE,
  1889. X              PANEL_LABEL_STRING,
  1890. X***************
  1891. X*** 638,644
  1892. X              PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4,
  1893. X              PANEL_VALUE_DISPLAY_LENGTH, 4,
  1894. X              PANEL_ITEM_X, ATTR_COL(1),
  1895. X!             PANEL_ITEM_Y, ATTR_ROW(4),
  1896. X              PANEL_BLINK_CARET, TRUE,
  1897. X              0);
  1898. X  
  1899. X
  1900. X--- 656,662 -----
  1901. X              PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4,
  1902. X              PANEL_VALUE_DISPLAY_LENGTH, 4,
  1903. X              PANEL_ITEM_X, ATTR_COL(1),
  1904. X!             PANEL_ITEM_Y, ATTR_ROW(5),
  1905. X              PANEL_BLINK_CARET, TRUE,
  1906. X              0);
  1907. X  
  1908. X***************
  1909. X*** 651,657
  1910. X              "Mark in month/year display:",
  1911. X              PANEL_CHOICE_STRINGS, "Yes", "No", 0,
  1912. X              PANEL_ITEM_X, ATTR_COL(1),
  1913. X!             PANEL_ITEM_Y, ATTR_ROW(5),
  1914. X              0);
  1915. X  
  1916. X      window_fit(attr_panel);
  1917. X
  1918. X--- 669,675 -----
  1919. X              "Mark in month/year display:",
  1920. X              PANEL_CHOICE_STRINGS, "Yes", "No", 0,
  1921. X              PANEL_ITEM_X, ATTR_COL(1),
  1922. X!             PANEL_ITEM_Y, ATTR_ROW(6),
  1923. X              0);
  1924. X  
  1925. X      window_fit(attr_panel);
  1926. X***************
  1927. X*** 667,672
  1928. X      del_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1929. X              FRAME_SHOW_LABEL, FALSE,
  1930. X              WIN_ERROR_MSG, "Can't create delete frame.",
  1931. X              0);
  1932. X  
  1933. X      del_panel = window_create(del_frame, PANEL,
  1934. X
  1935. X--- 685,691 -----
  1936. X      del_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1937. X              FRAME_SHOW_LABEL, FALSE,
  1938. X              WIN_ERROR_MSG, "Can't create delete frame.",
  1939. X+             FRAME_CLOSED_RECT, closed_rect,
  1940. X              0);
  1941. X  
  1942. X      del_panel = window_create(del_frame, PANEL,
  1943. X***************
  1944. X*** 720,726
  1945. X      /* create new frame and canvas */
  1946. X      if (!sframe) {
  1947. X          sframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1948. X!                 WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
  1949. X                  FRAME_LABEL, "Solar Data",
  1950. X                  FRAME_SHOW_LABEL, TRUE,
  1951. X                  FRAME_DONE_PROC, sframe_done,
  1952. X
  1953. X--- 739,745 -----
  1954. X      /* create new frame and canvas */
  1955. X      if (!sframe) {
  1956. X          sframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1957. X!                 WIN_X, ATTR_COL(12),
  1958. X                  FRAME_LABEL, "Solar Data",
  1959. X                  FRAME_SHOW_LABEL, TRUE,
  1960. X                  FRAME_DONE_PROC, sframe_done,
  1961. X***************
  1962. X*** 725,730
  1963. X                  FRAME_SHOW_LABEL, TRUE,
  1964. X                  FRAME_DONE_PROC, sframe_done,
  1965. X                  WIN_ERROR_MSG, "Can't create sun data frame.",
  1966. X                  0);
  1967. X  
  1968. X          spanel = window_create(sframe, PANEL, WIN_FONT, font,
  1969. X
  1970. X--- 744,750 -----
  1971. X                  FRAME_SHOW_LABEL, TRUE,
  1972. X                  FRAME_DONE_PROC, sframe_done,
  1973. X                  WIN_ERROR_MSG, "Can't create sun data frame.",
  1974. X+                 FRAME_CLOSED_RECT, closed_rect,
  1975. X                  0);
  1976. X  
  1977. X          spanel = window_create(sframe, PANEL, WIN_FONT, font,
  1978. X***************
  1979. X*** 759,764
  1980. X      
  1981. X          write_sun_data();
  1982. X          window_fit(sframe);
  1983. X      } else
  1984. X          write_sun_data();
  1985. X  }
  1986. X
  1987. X--- 779,785 -----
  1988. X      
  1989. X          write_sun_data();
  1990. X          window_fit(sframe);
  1991. X+         window_set(sframe, WIN_SHOW, TRUE, 0);
  1992. X      } else
  1993. X          write_sun_data();
  1994. X  }
  1995. X***************
  1996. X*** 773,779
  1997. X      /* create new frame and canvas */
  1998. X      if (!mframe) {
  1999. X          mframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  2000. X!                 WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
  2001. X                  FRAME_LABEL, "Lunar Data",
  2002. X                  FRAME_SHOW_LABEL, TRUE,
  2003. X                  FRAME_INHERIT_COLORS, TRUE,
  2004. X
  2005. X--- 794,800 -----
  2006. X      /* create new frame and canvas */
  2007. X      if (!mframe) {
  2008. X          mframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  2009. X!                 WIN_X, ATTR_COL(12),
  2010. X                  FRAME_LABEL, "Lunar Data",
  2011. X                  FRAME_SHOW_LABEL, TRUE,
  2012. X                  FRAME_FOREGROUND_COLOR, &fg_default,
  2013. X***************
  2014. X*** 776,782
  2015. X                  WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
  2016. X                  FRAME_LABEL, "Lunar Data",
  2017. X                  FRAME_SHOW_LABEL, TRUE,
  2018. X-                 FRAME_INHERIT_COLORS, TRUE,
  2019. X                  FRAME_FOREGROUND_COLOR, &fg_default,
  2020. X                  FRAME_BACKGROUND_COLOR, &bg_default,
  2021. X                  FRAME_DONE_PROC, mframe_done,
  2022. X
  2023. X--- 797,802 -----
  2024. X                  WIN_X, ATTR_COL(12),
  2025. X                  FRAME_LABEL, "Lunar Data",
  2026. X                  FRAME_SHOW_LABEL, TRUE,
  2027. X                  FRAME_FOREGROUND_COLOR, &fg_default,
  2028. X                  FRAME_BACKGROUND_COLOR, &bg_default,
  2029. X                  FRAME_DONE_PROC, mframe_done,
  2030. X***************
  2031. X*** 781,786
  2032. X                  FRAME_BACKGROUND_COLOR, &bg_default,
  2033. X                  FRAME_DONE_PROC, mframe_done,
  2034. X                  WIN_ERROR_MSG, "Can't create moon data frame.",
  2035. X                  0);
  2036. X  
  2037. X          mpanel = window_create(mframe, PANEL, WIN_FONT, font,
  2038. X
  2039. X--- 801,807 -----
  2040. X                  FRAME_BACKGROUND_COLOR, &bg_default,
  2041. X                  FRAME_DONE_PROC, mframe_done,
  2042. X                  WIN_ERROR_MSG, "Can't create moon data frame.",
  2043. X+                 FRAME_CLOSED_RECT, closed_rect,
  2044. X                  0);
  2045. X  
  2046. X          mpanel = window_create(mframe, PANEL, WIN_FONT, font,
  2047. X***************
  2048. X*** 816,821
  2049. X      
  2050. X          write_moon_data();
  2051. X          window_fit(mframe);
  2052. X      } else
  2053. X          write_moon_data();
  2054. X  }
  2055. X
  2056. X--- 837,843 -----
  2057. X      
  2058. X          write_moon_data();
  2059. X          window_fit(mframe);
  2060. X+         window_set(mframe, WIN_SHOW, TRUE, 0);
  2061. X      } else
  2062. X          write_moon_data();
  2063. X  }
  2064. X***************
  2065. X*** 833,838
  2066. X              FRAME_SHOW_LABEL, TRUE,
  2067. X              FRAME_DONE_PROC, fileframe_done,
  2068. X              WIN_ERROR_MSG, "Can't create file frame.",
  2069. X              0);
  2070. X  
  2071. X      filepanel = window_create(fileframe, PANEL, WIN_FONT, font,
  2072. X
  2073. X--- 855,861 -----
  2074. X              FRAME_SHOW_LABEL, TRUE,
  2075. X              FRAME_DONE_PROC, fileframe_done,
  2076. X              WIN_ERROR_MSG, "Can't create file frame.",
  2077. X+             FRAME_CLOSED_RECT, closed_rect,
  2078. X              0);
  2079. X  
  2080. X      filepanel = window_create(fileframe, PANEL, WIN_FONT, font,
  2081. X***************
  2082. X*** 925,930
  2083. X                  WIN_SHOW, TRUE,
  2084. X                  WIN_X, ATTR_COL(15), WIN_Y, ATTR_ROW(15),
  2085. X                  WIN_ERROR_MSG, "Can't create error frame.",
  2086. X                  0);
  2087. X  
  2088. X          prompt_panel = window_create(prompt_frame, PANEL,
  2089. X
  2090. X--- 948,954 -----
  2091. X                  WIN_SHOW, TRUE,
  2092. X                  WIN_X, ATTR_COL(15), WIN_Y, ATTR_ROW(15),
  2093. X                  WIN_ERROR_MSG, "Can't create error frame.",
  2094. X+                 FRAME_CLOSED_RECT, closed_rect,
  2095. X                  0);
  2096. X  
  2097. X          prompt_panel = window_create(prompt_frame, PANEL,
  2098. X***************
  2099. X*** 995,1000
  2100. X              FRAME_SHOW_LABEL, TRUE,
  2101. X              FRAME_DONE_PROC, prframe_done,
  2102. X              WIN_ERROR_MSG, "Can't create printer frame.",
  2103. X              0);
  2104. X  
  2105. X      prpanel = window_create(prframe, PANEL, WIN_FONT, font,
  2106. X
  2107. X--- 1019,1025 -----
  2108. X              FRAME_SHOW_LABEL, TRUE,
  2109. X              FRAME_DONE_PROC, prframe_done,
  2110. X              WIN_ERROR_MSG, "Can't create printer frame.",
  2111. X+             FRAME_CLOSED_RECT, closed_rect,
  2112. X              0);
  2113. X  
  2114. X      prpanel = window_create(prframe, PANEL, WIN_FONT, font,
  2115. X***************
  2116. X*** 1039,1044
  2117. X              FRAME_SHOW_LABEL, TRUE,
  2118. X              FRAME_DONE_PROC, dtframe_done,
  2119. X              WIN_ERROR_MSG, "Can't create date frame.",
  2120. X              0);
  2121. X  
  2122. X      dtpanel = window_create(date_frame, PANEL, WIN_FONT, font,
  2123. X
  2124. X--- 1064,1070 -----
  2125. X              FRAME_SHOW_LABEL, TRUE,
  2126. X              FRAME_DONE_PROC, dtframe_done,
  2127. X              WIN_ERROR_MSG, "Can't create date frame.",
  2128. X+             FRAME_CLOSED_RECT, closed_rect,
  2129. X              0);
  2130. X  
  2131. X      dtpanel = window_create(date_frame, PANEL, WIN_FONT, font,
  2132. X***************
  2133. X*** 1057,1063
  2134. X              PANEL_SHOW_ITEM, TRUE,
  2135. X              PANEL_ITEM_X, ATTR_COL(1),
  2136. X              PANEL_ITEM_Y, ATTR_ROW(1)+5,
  2137. X!             PANEL_LABEL_STRING, "Enter date (D, M/D, or M/D/Y):",
  2138. X              PANEL_LABEL_FONT, font,
  2139. X              PANEL_LABEL_BOLD, TRUE,
  2140. X              PANEL_VALUE_STORED_LENGTH, 10,
  2141. X
  2142. X--- 1083,1089 -----
  2143. X              PANEL_SHOW_ITEM, TRUE,
  2144. X              PANEL_ITEM_X, ATTR_COL(1),
  2145. X              PANEL_ITEM_Y, ATTR_ROW(1)+5,
  2146. X!             PANEL_LABEL_STRING, (day_first ? "Enter date (D, D/M, or D/M/Y):" : "Enter date (D, M/D, or M/D/Y):"),
  2147. X              PANEL_LABEL_FONT, font,
  2148. X              PANEL_LABEL_BOLD, TRUE,
  2149. X              PANEL_VALUE_STORED_LENGTH, 10,
  2150. X***************
  2151. X*** 1065,1071
  2152. X              PANEL_BLINK_CARET, TRUE,
  2153. X              0);
  2154. X      
  2155. X!     sprintf(date, "%d/%d/%02d", current.tm_mon+1, current.tm_mday, current.tm_year);
  2156. X      panel_set_value(setdate_pi, date);
  2157. X      window_fit(dtpanel);
  2158. X      window_fit(date_frame);
  2159. X
  2160. X--- 1091,1100 -----
  2161. X              PANEL_BLINK_CARET, TRUE,
  2162. X              0);
  2163. X      
  2164. X!     if (day_first)
  2165. X!         sprintf(date, "%d/%d/%02d", current.tm_mday, current.tm_mon+1, current.tm_year);
  2166. X!     else
  2167. X!         sprintf(date, "%d/%d/%02d", current.tm_mon+1, current.tm_mday, current.tm_year);
  2168. X      panel_set_value(setdate_pi, date);
  2169. X      window_fit(dtpanel);
  2170. X      window_fit(date_frame);
  2171. END_OF_FILE
  2172. if test 57477 -ne `wc -c <'patches05c'`; then
  2173.     echo shar: \"'patches05c'\" unpacked with wrong size!
  2174. fi
  2175. # end of 'patches05c'
  2176. fi
  2177. echo shar: End of archive 3 \(of 4\).
  2178. cp /dev/null ark3isdone
  2179. MISSING=""
  2180. for I in 1 2 3 4 ; do
  2181.     if test ! -f ark${I}isdone ; then
  2182.     MISSING="${MISSING} ${I}"
  2183.     fi
  2184. done
  2185. if test "${MISSING}" = "" ; then
  2186.     echo You have unpacked all 4 archives.
  2187.     rm -f ark[1-9]isdone
  2188. else
  2189.     echo You still need to unpack the following archives:
  2190.     echo "        " ${MISSING}
  2191. fi
  2192. ##  End of shell archive.
  2193. exit 0
  2194.  
  2195.